
// 列表中按照id删除某一项
$("#dataContainer").delegate('.js-delete', 'click', function() {
    if (!confirm("确定要删除这条记录？")) {
        return false;
    }
    var id = $(this).attr('data-id');
    var url = './delete';
    var param = {
        id: id
    }
    $.post(url, param, function(resp) {
        if (resp.code != 0) {
            doAlert(resp.message || '操作失败');
            return false;
        }
        doAlert('操作成功！', 1500, 'success', function() {
            if (typeof loadData == 'function') {
                loadData();
            } else {
                if(typeof loadPage == 'function'){
                    loadPage();
                }else{
                    window.location.reload();
                }
            }
        })
    })
})